Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
Odoo 15 | act_window con useService Hook no funciona en el componente OWL personalizado en el método de configuración

Estoy tratando de registrar una ventana act_window dentro del método de configuración usando useService Hook, pero no funciona.

Este es mi componente.

 /** @odoo-module **/ // const { useState, useRef } = owl.hooks; import { useEffect, useService } from "@web/core/utils/hooks"; import AbstractField from 'web.AbstractFieldOwl' import { _lt } from 'web.translation'; class ReferenceButtonWidget extends AbstractField { setup() { // super.setup(...arguments); this.actionService = useService('action') // <----------------- ERROR } onClick() { console.log(this.value); } } ReferenceButtonWidget.description = _lt("Reference"); ReferenceButtonWidget.supportedFieldTypes = ['reference']; ReferenceButtonWidget.template = 'iqba_document.reference_button_widget'; const registry = require('web.field_registry_owl'); registry.add('reference_button_widget', ReferenceButtonWidget)

Si comento la línea this.actionService = useService('action') , mi componente funciona bien.

Si hago una pausa en la ejecución en ese punto, solo estos servicios están disponibles:

consola de depuración del navegador

¿Qué estoy haciendo mal? Gracias

Por ahora estoy usando esto para llamar a una acción:

 this.__owl__.parent.parentWidget.do_action({ type: 'ir.actions.act_window', res_model: this.value.model, res_id: this.value.res_id, views: [[false, 'form']], target: 'new' })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!